{include file='public/_head'}
<!-- Main Container -->
<div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">

        <!-- Page Sidebar -->
        {include file='public/_left'}
        <!-- /Page Sidebar -->
        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="fa fa-home"></i>&nbsp;日本留学
                    </li>
                    <li>留学费用</li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->
            <!-- Page Body -->
            <div class="page-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="widget radius-bordered">
                            <div class="widget-header bordered-bottom bordered-themeprimary">
                                <span class="widget-caption">留学费用编辑</span>
                            </div>
                            <div class="widget-body">
                                <form action="" class="form-horizontal">
                                    <div class="form-group">
                                        <input type="hidden" name="id" value="{$in.id}">
                                    </div>

                                    <div class="form-group">
                                        <label for="title" class="col-sm-2 control-label">标题：</label>
                                        <div class="col-sm-6">
                                            <input type="hidden" name="id" value="{$in.id}" />
                                            <input type="text" class="form-control" id="title" name="title" value="{$in.title}" placeholder="xxxxxxxxx" />
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label for="content" class="control-label col-sm-2">内容：</label>
                                        <div class="col-sm-6">
                                            <textarea name="content" id="content" cols="30" rows="10">{$in.content}</textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-6">
                                            <button class="btn btn-primary" id="articleadd">更新</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->

    </div>
    <!-- /Page Container -->
    <!-- Main Container -->

</div>

{include file='public/_js'}
<script src="/static/admin/lib/ueditor/ueditor.config.js"></script>
<script src="/static/admin/lib/ueditor/ueditor.all.js"></script>
<script>
    $(function () {
        UE.getEditor('content',{
            /*toolbars: [
                ['fullscreen', 'source', 'undo', 'redo', 'bold']
            ],*/
            /*autoHeightEnabled: true,
            autoFloatEnabled: true,*/
            initialFrameWidth:1000,
            initialFrameHeight:490
        });

        $('#articleadd').click(function (){
            $.ajax({
                url:"{:url('admin/introduce/introduce_cost')}",
                type:"post",
                data:$('form').serialize(),
                dataType:"json",
                success:function (data) {
                    if (data.code == 1){
                        layer.msg(data.msg,{
                            icon:6,
                            time:1000
                        },function () {
                            location.href = data.url;
                        });
                    } else {
                        layer.open({
                            title:'内容编辑！',
                            content:data.msg,
                            icon:5,
                            anim:6
                        });
                    }
                }
            });
            return false;
        });
    });
</script>
</body>
<!--  /Body -->
</html>
